import request from './request'

function beforeRequest(_, config = {}) {
  console.log(config)
}

const proxy = new Proxy(request, {
  async apply(target, thisArg, args) {
    await beforeRequest(...args)
    return target(...args)
  }
})

export default proxy
